package test1230am;

public class Test10 {
    public static void main(String[] args) {

        // (10)求数组中最大的元素
        int[] arr = {5, 3, 8, 2, 6};
        int max = 0;
        for(int i = 0; i <arr.length ; i++){
            if(arr[i] > max){
                max = arr[i];
            }
        }
        System.out.println(max);
    }
}
